module teapo.app.tests {
export class TestCase {
state = ko.observable(TestCase.State.NotStarted);
runtime = ko.observable<number>(null);
failure = ko.observable<Error>(null);
private _started = -1;
constructor(public name: string,
private _test: Function) {
}
start() {if (this.state() !== TestCase.State.NotStarted)
throw new Error('Test case already started (' + TestCase.State[this.state()] + ').');
this.state(TestCase.State.Running);
this.runtime(0);
this._started = 0;
try {}
catch (error) {
this.state
}
}
}
export module TestCase {
export enum State {
NotStarted, Running, Succeeded, Failed}
}
}